<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人网站</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Arial', sans-serif;
            background: #0a0a0a;
            color: #fff;
            overflow: hidden;
            height: 100vh;
            margin: 0;
            padding: 0;
        }

        #canvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 1;
            display: block;
        }

        .content {
            position: relative;
            z-index: 2;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
            text-align: center;
            pointer-events: none;
        }

        h1 {
            font-size: 5em;
            font-weight: 300;
            letter-spacing: 0.1em;
            margin-bottom: 20px;
            opacity: 0;
            animation: fadeIn 2s ease forwards;
            text-shadow: 0 0 20px rgba(255,255,255,0.5);
        }

        p {
            font-size: 1.5em;
            font-weight: 300;
            opacity: 0;
            animation: fadeIn 2s ease 0.5s forwards;
        }

        @keyframes fadeIn {
            to {
                opacity: 1;
            }
        }

        @media (max-width: 768px) {
            h1 {
                font-size: 3em;
            }
            p {
                font-size: 1.2em;
            }
        }
    </style>
</head>
<body>
    <canvas id="canvas"></canvas>
    <div class="content">
        <h1>YOUR NAME</h1>
        <p>Creative Developer</p>
    </div>

    <script>
        const canvas = document.getElementById('canvas');
        const ctx = canvas.getContext('2d');
        
        let width = canvas.width = window.innerWidth;
        let height = canvas.height = window.innerHeight;
        
        const particles = [];
        const particleCount = 150;
        const connectionDistance = 150;
        const mouse = { x: width / 2, y: height / 2, radius: 150 };
        
        class Particle {
            constructor() {
                this.x = Math.random() * width;
                this.y = Math.random() * height;
                this.baseX = this.x;
                this.baseY = this.y;
                this.vx = (Math.random() - 0.5) * 0.5;
                this.vy = (Math.random() - 0.5) * 0.5;
                this.size = Math.random() * 2 + 1;
                this.angle = Math.random() * Math.PI * 2;
                this.angleVelocity = (Math.random() - 0.5) * 0.02;
            }
            
            update() {
                // 鼠标排斥力
                const dx = mouse.x - this.x;
                const dy = mouse.y - this.y;
                const distance = Math.sqrt(dx * dx + dy * dy);
                
                if (distance < mouse.radius) {
                    const force = (mouse.radius - distance) / mouse.radius;
                    const angle = Math.atan2(dy, dx);
                    this.x -= Math.cos(angle) * force * 5;
                    this.y -= Math.sin(angle) * force * 5;
                }
                
                // 螺旋运动
                this.angle += this.angleVelocity;
                const spiralRadius = Math.sin(this.angle) * 20;
                
                // 向基准点回归
                const baseDistance = Math.sqrt(
                    (this.baseX - this.x) ** 2 + 
                    (this.baseY - this.y) ** 2
                );
                
                if (baseDistance > 100) {
                    this.x += (this.baseX - this.x) * 0.01;
                    this.y += (this.baseY - this.y) * 0.01;
                }
                
                // 添加螺旋偏移和基础运动
                this.x += this.vx + Math.cos(this.angle) * spiralRadius * 0.01;
                this.y += this.vy + Math.sin(this.angle) * spiralRadius * 0.01;
                
                // 边界检测
                if (this.x < 0 || this.x > width) this.vx *= -1;
                if (this.y < 0 || this.y > height) this.vy *= -1;
                
                // 波动效果
                const waveX = Math.sin(Date.now() * 0.001 + this.baseX * 0.01) * 2;
                const waveY = Math.cos(Date.now() * 0.001 + this.baseY * 0.01) * 2;
                this.x += waveX;
                this.y += waveY;
            }
            
            draw() {
                ctx.beginPath();
                ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
                ctx.fillStyle = `rgba(255, 255, 255, ${0.5 + Math.sin(this.angle) * 0.3})`;
                ctx.fill();
            }
        }
        
        // 初始化粒子
        for (let i = 0; i < particleCount; i++) {
            particles.push(new Particle());
        }
        
        // 连接粒子
        function connectParticles() {
            for (let i = 0; i < particles.length; i++) {
                for (let j = i + 1; j < particles.length; j++) {
                    const dx = particles[i].x - particles[j].x;
                    const dy = particles[i].y - particles[j].y;
                    const distance = Math.sqrt(dx * dx + dy * dy);
                    
                    if (distance < connectionDistance) {
                        const opacity = 1 - distance / connectionDistance;
                        ctx.beginPath();
                        ctx.strokeStyle = `rgba(100, 150, 255, ${opacity * 0.3})`;
                        ctx.lineWidth = 0.5;
                        ctx.moveTo(particles[i].x, particles[i].y);
                        ctx.lineTo(particles[j].x, particles[j].y);
                        ctx.stroke();
                    }
                }
            }
        }
        
        // 动画循环
        function animate() {
            ctx.fillStyle = 'rgba(10, 10, 10, 0.1)';
            ctx.fillRect(0, 0, width, height);
            
            particles.forEach(particle => {
                particle.update();
                particle.draw();
            });
            
            connectParticles();
            
            requestAnimationFrame(animate);
        }
        
        // 鼠标追踪
        canvas.addEventListener('mousemove', (e) => {
            mouse.x = e.clientX;
            mouse.y = e.clientY;
        });
        
        // 窗口大小调整
        window.addEventListener('resize', () => {
            width = canvas.width = window.innerWidth;
            height = canvas.height = window.innerHeight;
        });
        
        animate();
    </script>
</body>
</html>